<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.welfare.admin.call.*" %>
<%

	
	String counsel_id		= StringUtil.nvl(request.getParameter("counsel_id"));



	HashMap infos = new HashMap();
	infos.put("counsel_id",	counsel_id);


	CallDAO dao 		= new CallDAO();
	HashList info		= dao.selectCounselInfo(infos);		



%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= SYSTEM_NAME %></title>
	<%@ include file="/admin/include/cssnjs.jsp"  %>

	<script type="text/javascript">
	
	
	$(document).ready(function() {
		
	});


	function fnDelete() {
		if (confirm(MSG_D)) {
			
			$.ajax({
				url: './counselSave.do',
				type: "POST",
			    dataType: 'json',//html,text,json
			    data: $('#saveForm').serialize(),
			    error: function(data, status, err){
			    	alert(err);
			    },
				success: function(data){
					if (data.result_code == 'SESSION_TIMEOUT') {
						alert("오랜시간 사용하지 않아 로그아웃되었습니다.\n로그인화면으로 이동합니다.");
						self.close();
						opener.top.location.href = "/admin";
					} else {
						self.close();
						opener.fnCallBackSearch('RELOAD_COUNSEL_LIST');
					}
			    }
			});
		}
	}

	
	function fnExcelDownload() {
		document.excelForm.excel_data.value = $('#excel_data').html();
		document.excelForm.submit();
	}

	</script>
</head>
<body>
<div id="wrap">
		<div id="popup">
			<div class="menu_title">
				<h1>고객상담이력</h1>
				<div class="r mt2">
			<%	if (isAdmin) { %>
					<a href="./counselUpdate.jsp?counsel_id=<%=counsel_id %>" ><img src="../images/btn_update.gif"/></a>
					<a href="#nohref" onclick="fnDelete()"><img src="../images/btn_delete.gif" /></a>
			<%	} %>
					<a href="#nohref" onclick="fnExcelDownload()"><img src="../images/btn_excel.gif"/></a>
					<input type="image" class="button" src="../images/btn_close.gif" onclick="self.close()"/>
				</div>
			</div>
			<div class="clear line_01"></div>

			<form name="excelForm" method="post" action="/common/excel_view.jsp">
				<input type="hidden" name="excel_title" value="고객상담이력"/>
				<input type="hidden" name="excel_data" value=""/>
			</form>
			
			<form name="saveForm" id="saveForm" method="post" action="">
				<input type="hidden" name="job_type" id="job_type" value="D"/>
				<input type="hidden" name="counsel_id" value="<%=counsel_id %>"/>
			</form>
			
			
			<div id="excel_data">
			<h3>고객정보</h3>

			<table cellpadding="0" cellspacing="0" class="table_01 mt5">
			<colgroup>
				<col width="80px"/>
				<col/>
				<col width="80px"/>
				<col/>
				<col width="80px"/>
				<col/>
			</colgroup>
			<tbody>
				<tr>
					<th><p>이름</p></th>
					<td>
						<%= info.get("customer_name", 0) %>
					</td>
					<th><p>생년월일</p></th>
					<td>
						<%= info.get("birth_date", 0) %>
					</td>
					<th><p>성별</p></th>
					<td>
						<%= info.get("gender_name", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>세대구분</p></th>
					<td>
						<%= info.get("family_gubn_name", 0) %>
					</td>
					<th><p>가구원수</p></th>
					<td>
						<%= info.get("family_count", 0) %>
					</td>
					<th><p>보장구분</p></th>
					<td>
						<%= info.get("support_gubn_name", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>전화번호</p></th>
					<td>
						<%= info.get("tel_no", 0) %>
					</td>
					<th><p>핸드폰번호</p></th>
					<td>
						<%= info.get("hp_no", 0) %>
					</td>
					<th><p>수신동의</p></th>
					<td>
						<%= "Y".equals(info.get("tel_agree_yn", 0)) ? "전화(O)" : "전화(X)" %>, 
						<%= "Y".equals(info.get("sms_agree_yn", 0)) ? "SMS(O)" : "SMS(X)" %>
					</td>
				</tr>
				<tr>
					<th><p>행정동</p></th>
					<td>
						<%= info.get("dong_name", 0) %>
					</td>
					<th><p>주소</p></th>
					<td colspan="3">
						<%= info.getToBr("address", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>비고</p></th>
					<td colspan="5">
						<%= info.getToBr("remarks", 0) %>
					</td>
				</tr>
			</tbody>
			</table>
			
			
			<h3>상담정보</h3>

			<table cellpadding="0" cellspacing="0" class="table_01 mt5">
			<colgroup>
				<col width="80px"/>
				<col/>
				<col width="80px"/>
				<col/>
				<col width="80px"/>
				<col/>
			</colgroup>
			<tbody>
				<tr>
					<th><p>상담경로</p></th>
					<td>
						<%= info.get("counsel_path_name", 0) %>
					</td>
					<th><p>상담일자</p></th>
					<td>
						<%= StringUtil.toDate(info.get("counsel_date", 0)) %>
					</td>
					<th><p>상담유형</p></th>
					<td>
						<%= info.get("counsel_type_name", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>분류1</p></th>
					<td>
						<%= info.get("counsel_kind1_name", 0) %> - <%= info.get("counsel_part1_name", 0) %>
					</td>
					<th><p>분류2</p></th>
					<td>
						<%= info.get("counsel_kind2_name", 0) %> - <%= info.get("counsel_part2_name", 0) %>
					</td>
					<th><p>분류3</p></th>
					<td>
						<%= info.get("counsel_kind3_name", 0) %> - <%= info.get("counsel_part3_name", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>서비스명</p></th>
					<td colspan="5">
						<%= info.get("service_name", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>상담질문</p></th>
					<td colspan="5">
						<%= info.getToBr("question", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>상담답변</p></th>
					<td colspan="5">
						<%= info.getToBr("answer", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>특이사항</p></th>
					<td colspan="5">
						<%= info.getToBr("note", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>알림요청</p></th>
					<td >
						<%= info.get("alarm_name", 0) %>
					</td>
					<th><p>상담결과</p></th>
					<td colspan="3">
						<%= info.get("counsel_result_name", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>등록자</p></th>
					<td >
						<%= info.get("reg_user", 0) %>
					</td>
					<th><p>등록일시</p></th>
					<td colspan="3">
						<%= info.getDate("reg_date", 0) %>
					</td>
				</tr>
				
			</tbody>
			</table>
			</div>
		</div>
		
</div>



</body>
</html>
